/**
 * Copyright &copy; 2012-2014 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package cn.knet.sp.ncrm.modules.customer.aftersalesservice.entity;

import com.fasterxml.jackson.annotation.JsonFormat;

import org.hibernate.validator.constraints.Length;

import java.util.Date;

import javax.validation.constraints.NotNull;

import cn.knet.sp.ncrm.common.persistence.DataEntity;

/**
 * 成单信息Entity
 * @author 冯亚鹏
 * @version 2015-09-01
 */
public class PotentialAfterSalesService extends DataEntity<PotentialAfterSalesService> {
	
	private static final long serialVersionUID = 1L;
	private Long version = 0L;		// version
	private String address;		// 地址
	private String amount;		// 金额
	private String backCash;		// 返现
	private String board;		// 牌匾
	private Date dateCreated;		// 创建时间
	private String detail;		// 描述
	private String gift;		// 礼品
	private String invoice;		// 发票
	private Date lastUpdated;		// 更新时间
	private String phone;		// 电话
	private String potentialCustomerId;		// 潜在客户id
	private String receiver;		// 收款人
	private Long year;		// 年限
	private String targetproducts;		// 成单产品
	private String onshow;	//是否展示 1 展示 0 取消
	private String productName;
	private String createUsername;

	/**成单展示的附加信息**/
	private String corporationName; //客户名称
	private String customerType;//客户类型
	private String customerFeature;//客户特点
	private Date beginDate;
	private Date endDate;
	private String[] fIds;

	public PotentialAfterSalesService() {
		super();
	}

	public PotentialAfterSalesService(String id){
		super(id);
	}

	/**
	 * 插入之前执行方法，需要手动调用
	 */
	@Override
	public void preInsert(){
		// 不限制ID为UUID，调用setIsNewRecord()使用自定义ID
		this.version = 1L;
		super.preInsert();
	}

	/**
	 * 更新之前执行方法，需要手动调用
	 */
	@Override
	public void preUpdate(){
		this.setLastUpdated(new Date());
	}

	@NotNull(message="version不能为空")
	public Long getVersion() {
		return version;
	}

	public void setVersion(Long version) {
		this.version = version;
	}
	
	@Length(min=0, max=128, message="地址长度必须介于 0 和 128 之间")
	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}
	
	public String getAmount() {
		return amount;
	}

	public void setAmount(String amount) {
		this.amount = amount;
	}
	
	@Length(min=0, max=64, message="返现长度必须介于 0 和 64 之间")
	public String getBackCash() {
		return backCash;
	}

	public void setBackCash(String backCash) {
		this.backCash = backCash;
	}
	
	@Length(min=0, max=64, message="牌匾长度必须介于 0 和 64 之间")
	public String getBoard() {
		return board;
	}

	public void setBoard(String board) {
		this.board = board;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@NotNull(message="创建时间不能为空")
	public Date getDateCreated() {
		return dateCreated;
	}

	public void setDateCreated(Date dateCreated) {
		this.dateCreated = dateCreated;
	}
	
	@Length(min=0, max=255, message="描述长度必须介于 0 和 512 之间")
	public String getDetail() {
		return detail;
	}

	public void setDetail(String detail) {
		this.detail = detail;
	}
	
	@Length(min=0, max=64, message="礼品长度必须介于 0 和 128 之间")
	public String getGift() {
		return gift;
	}

	public void setGift(String gift) {
		this.gift = gift;
	}
	
	@Length(min=0, max=64, message="发票长度必须介于 0 和 128 之间")
	public String getInvoice() {
		return invoice;
	}

	public void setInvoice(String invoice) {
		this.invoice = invoice;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@NotNull(message="更新时间不能为空")
	public Date getLastUpdated() {
		return lastUpdated;
	}

	public void setLastUpdated(Date lastUpdated) {
		this.lastUpdated = lastUpdated;
	}
	
	@Length(min=0, max=16, message="电话长度必须介于 0 和 32 之间")
	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}
	
	@Length(min=1, max=64, message="潜在客户id长度必须介于 1 和 64 之间")
	public String getPotentialCustomerId() {
		return potentialCustomerId;
	}

	public void setPotentialCustomerId(String potentialCustomerId) {
		this.potentialCustomerId = potentialCustomerId;
	}
	
	@Length(min=0, max=64, message="收款人长度必须介于 0 和 64 之间")
	public String getReceiver() {
		return receiver;
	}

	public void setReceiver(String receiver) {
		this.receiver = receiver;
	}
	
	public Long getYear() {
		return year;
	}

	public void setYear(Long year) {
		this.year = year;
	}
	
	@Length(min=0, max=32, message="成单产品长度必须介于 0 和 32 之间")
	public String getTargetproducts() {
		return targetproducts;
	}

	public void setTargetproducts(String targetproducts) {
		this.targetproducts = targetproducts;
	}

	public String getCorporationName() {
		return corporationName;
	}

	public void setCorporationName(String corporationName) {
		this.corporationName = corporationName;
	}

	public String getCustomerType() {
		return customerType;
	}

	public void setCustomerType(String customerType) {
		this.customerType = customerType;
	}

	public String getCustomerFeature() {
		return customerFeature;
	}

	public void setCustomerFeature(String customerFeature) {
		this.customerFeature = customerFeature;
	}

	public String getOnshow() {
		return onshow;
	}

	public void setOnshow(String onshow) {
		this.onshow = onshow;
	}

	public Date getBeginDate() {
		return beginDate;
	}

	public void setBeginDate(Date beginDate) {
		this.beginDate = beginDate;
	}

	public Date getEndDate() {
		return endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}

	public String[] getfIds() {
		return fIds;
	}

	public void setfIds(String[] fIds) {
		this.fIds = fIds;
	}

	public String getProductName() {
		return productName;
	}

	public void setProductName(String productName) {
		this.productName = productName;
	}

	public String getCreateUsername() {
		return createUsername;
	}

	public void setCreateUsername(String createUsername) {
		this.createUsername = createUsername;
	}
}
